<%@ page contentType="text/html; charset=UTF-8"%>
<%@ include file="/jsp/jscommom.jsp"%>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>企业注册</title>
		<link href="/css/style.css" rel="stylesheet" type="text/css" />
	</head>
	<script type="text/javascript" src="/js/prototype-1.5.1.2.js"
		charset="UTF-8"></script>
	<script type="text/javascript">

//检查用户名是否存在
function checkLoginName(){
        var lname = document.all.loginName.value;
        if(lname=="" || lname.length<0){
        alert("\u5bf9\u4e0d\u8d77\uff0c\u7528\u6237\u540d\u4e0d\u80fd\u4e3a\u7a7a\uff01");
        document.all.loginName.value="";
        document.all.loginName.focus();
        }else{
    	var url = '/com/checkcorloginname.do';
        var pars = 'lname='+lname;
     
        var myAjax = new Ajax.Updater({success:'checkloginname'}, url, {method: 'get', parameters: pars});
        }
    	}
    	
//必填项
 function doMethod()
 {
    if(document.all.loginName.value=="" || document.all.password.value==""){
    alert("对不起,帐号和密码不能为空!");
    return false;
    }
    if(document.all.corporName.value==""){
    alert("对不起,企业名称不能为空!");
    return false;
    }
    if(document.all.contactPerson.value==""){
    alert("对不起,联系人不能为空!");
    return;
    }
    if(document.all.telephone.value==""){
    alert("对不起,电话号码不能为空!");
    return false;
    }
    if(document.all.mobilphone.value==""){
    alert("对不起,手机号码不能为空!");
    return false;
    }
    if(document.all.email.value==""){
    alert("对不起,邮箱不能为空!");
    return false;
    }
    if(document.all.contactAddress.value==""){
    alert("对不起,联系地址不能为空!");
    return false;
    }
    
 }
 //检查密码
 function checkPwd(){
		if (document.all.password.value != document.all.repassword.value){
			alert('\u5bf9\u4e0d\u8d77\uff0c\u4e24\u6b21\u8f93\u5165\u7684\u5bc6\u7801\u4e0d\u4e00\u81f4\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165\uff01');
			document.all.password.value = "";
			document.all.repassword.value ="";
			document.all.password.focus();
		}
	}
</script>
	<body>
		<html:form action="/com/struts/web/corpor/register/corporbase"
			method="post" onsubmit="return doMethod()">
			<table width="880" border="0" align="center" cellpadding="0"
			cellspacing="0">
				<%@ include file="/jsp/top.jsp" %>
				<tr>
				<td>
				<span height="10"></span>
				</td>
				</tr>
				<tr>
					<td>
						<table width="880" border="0" align="center" cellpadding="0"
					cellspacing="1" class="line1">
							<tr>
								<td class="titlebg1" colspan="2">
									基本信息
								</td>
							</tr>

							<tr>
								<td class="mtdtitle1">
									*帐号:
								</td>
								<td class="mtdtextleft">
									<html:text property="loginName" onblur="checkLoginName()" styleClass="input1"></html:text>
									<div id="checkloginname"></div>
								</td>
							</tr>

							<tr>
								<td class="mtdtitle1">
									*密码:
								</td>
								<td class="mtdtextleft">
									<html:password property="password" styleClass="input1"></html:password>
								</td>
							</tr>

							<tr>
								<td class="mtdtitle1">
									*&#30830;&#35748;&#23494;&#30721;&#65306;
								</td>
								<td class="mtdtextleft">
									<input type="password" onblur="checkPwd()" id="repassword" class="input1"/>
								</td>
							</tr>

							<tr>
								<td class="mtdtitle1">
									*企业名称:
								</td>
								<td class="mtdtextleft">
									<html:text property="corporName" styleClass="input1"></html:text>
									注:企业名称必须与注册名称相同
								</td>
							</tr>

							<tr>
								<td class="titlebg1" colspan="2">
									联系方式
								</td>
							</tr>

							<tr>
								<td class="mtdtitle1">
									*联系人:
								</td>
								<td class="mtdtextleft">
									<html:text property="contactPerson" styleClass="input1"></html:text>
								</td>
							</tr>

							<tr>
								<td class="mtdtitle1">
									*电话号码:
								</td>
								<td class="mtdtextleft">
									<html:text property="telephone" styleClass="input1"></html:text>
								</td>
							</tr>

							<tr>
								<td class="mtdtitle1">
									*手机:
								</td>
								<td class="mtdtextleft">
									<html:text property="mobilphone" styleClass="input1"></html:text>
								</td>
							</tr>

							<tr>
								<td class="mtdtitle1">
									*邮箱:
								</td>
								<td class="mtdtextleft">
									<html:text property="email" styleClass="input1"></html:text>
								</td>
							</tr>

							<tr>
								<td class="mtdtitle1">
									*联系地址:
								</td>
								<td class="mtdtextleft">
									<html:text property="contactAddress" styleClass="input1"></html:text>
								</td>
							</tr>

							<tr>
								<td colspan="2" class="mtdtitle1">
									<input type="submit" value="提交" class="tbutton"
										onclick="doMethod()" />
									<input type="reset" value="重置" class="tbutton"/>
						</table>
					</td>
				</tr>
				<%@ include file="/jsp/bottom.jsp" %>
			</table>
		</html:form>
	</body>
</html>
